<template>
  <markdown-view :content="todolist" />
</template>

<script>
import markdownView from "@/components/MarkdownView";
export default {
  components: {
    markdownView
  },
  computed: {
    todolist() {
      if (this.$store.state.todolist) return this.$store.state.todolist;
      return "# 加载中……";
    }
  },
  mounted() {
    if (!this.$store.state.todolist) {
      this.axios.get("docs/TODO.md").then(response => {
        this.$store.commit("setTodolist", response.data);
      });
    }
  }
};
</script>